﻿using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ReactiveUI.Fody.Helpers;

namespace Common.ViewModels
{
    /// <summary>
    /// 这里每个调度任务 存入调度任务集合里面 主干道单向锁系统,一但主干道锁住 其他机械手不可上主干道
    /// 任务
    /// </summary>
    [Serializable]
    [JsonObject(MemberSerialization.OptOut)]
    public class 调度任务: ViewModelNotify
    {

        private 节点 m_起始节点;

        public 节点 起始节点
        {
            get => m_起始节点;
            set
            {
                if (m_起始节点 == value)
                {
                    return;
                }
                m_起始节点=value;
                this.RaisePropertyChanged();
            }
        }

        [Reactive] public WorkStation WorkStation { get; set; }

        /// <summary>
        /// 目标节点
        /// </summary>
        [Reactive] public 节点 目标节点 { get; set; }

        /// <summary>
        /// 途径节点(路径)
        /// </summary>
        [Reactive]
        [JsonIgnore]
        public ObservableCollection<节点> 途径节点 { get; set; } = new ObservableCollection<节点>();


        private DateTime m_StartTime;

        /// <summary>
        /// 起始时间
        /// </summary>
        public DateTime StartTime
        {
            get=> m_StartTime;
            set
            {
                if (m_StartTime == value)
                {
                    return;
                }
                m_StartTime=value;
                this.RaisePropertyChanged();
            }
        }
        

    }

    public enum 任务类型
    {

    }
}
